var express = require("express");
var router = express.Router();
var complainModel = require("../../models/complain/complain_list");

router.post("/", function (req, res, next) {
  console.log(req.body.complainForm);
  let complainForm = req.body.complainForm;
  complainModel.find(
    {
      openid: complainForm.openid,
      type: complainForm.type,
      state: complainForm.state,
      publish_time: complainForm.publish_time,
    },
    function (err, docs) {
      if (!err) {
        res.json({ data: docs, msg: "返回成功！", code: 200 });
      }
    }
  );
});

module.exports = router;
